const express = require('express');
const router = express.Router();
const { authSuper } = require('../middleware/auth');
const {
   getCategories,
   createCategory,
   updateCategory,
   removeCategory,
} = require('../route-handlers/categories');

router.route('/').get(getCategories).post(authSuper, createCategory);
router
   .route('/:id')
   .patch(updateCategory)
   .delete(authSuper, removeCategory);

module.exports = router;
